package com.cookman.gameobjects.decks;

import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.cookman.assets.AssetMap;
import com.cookman.assets.AssetsImpl;
import com.cookman.assets.AssetsLocator;
import com.cookman.gameobjects.DiseaseCardActor;
import com.cookman.gameobjects.PlayerActor;
import com.cookman.gameobjects.controls.ModalPopup;
import com.cookman.world.entities.Disease;
import com.cookman.world.entities.Player;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Cookman on 12.09.14.
 */
public class PlayerDeckActor extends ModalPopup {

    private List<PlayerActor> playerActors;

    public PlayerDeckActor() {
        super();
    }

    private float padding = 0.2f;
    protected float scale = 0.4f;


    public void setPlayers(List<Player> players) {
        float startX = 0.2f;
        clearChildren();
        addAcceptCancel();
        playerActors = new ArrayList<>();
        if (players != null)
            for (Player player : players) {
                PlayerActor playerActor=new PlayerActor(player,this);
                playerActor.setX(startX);
                startX += padding + playerActor.getWidth();
                addActor(playerActor);
                playerActors.add(playerActor);
            }
    }

    public void resetSelection() {
        if (playerActors != null) {
            for (PlayerActor playerActor : playerActors) {
                playerActor.setIsSelected(false);
            }
        }
    }

    @Override
    public void renderShape(ShapeRenderer shapeRenderer) {

    }
}
